package lib

import (
	"context"
	"github.com/bndr/gojenkins"
)

func GetJenkinsJobConfig(jenkinsConnection *gojenkins.Jenkins, templateJobName string, parentFolder []string) (string, error) {
	ctx := context.Background()
	templateJob, err := jenkinsConnection.GetJob(ctx, templateJobName, parentFolder...)
	if err != nil {
		return "", err
	}
	return templateJob.GetConfig(ctx)
}
